<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>

<html class="app-ui">

<head>
    <!-- Meta -->
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>

    <!-- Document title -->
    <title>我的订单</title>

    <meta name="description" content="AppUI - Admin Dashboard Template & UI Framework"/>
    <meta name="author" content="rustheme"/>
    <meta name="robots" content="noindex, nofollow"/>

    <!-- Favicons -->
    <link rel="apple-touch-icon" href="${pageContext.request.contextPath}/assets/img/favicons/apple-touch-icon.png"/>
    <link rel="icon" href="${pageContext.request.contextPath}/assets/img/favicons/favicon.ico"/>


    <!-- AppUI CSS stylesheets -->
    <link rel="stylesheet" id="css-font-awesome" href="${pageContext.request.contextPath}/assets/css/font-awesome.css"/>
    <link rel="stylesheet" id="css-ionicons" href="${pageContext.request.contextPath}/assets/css/ionicons.css"/>
    <link rel="stylesheet" id="css-bootstrap" href="${pageContext.request.contextPath}/assets/css/bootstrap.css"/>
    <link rel="stylesheet" id="css-app" href="${pageContext.request.contextPath}/assets/css/app.css"/>
    <link rel="stylesheet" id="css-app-custom" href="${pageContext.request.contextPath}/assets/css/app-custom.css"/>
    <!-- End Stylesheets -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/js/layui/css/layui.css" media="all">
</head>

<body class="app-ui layout-has-drawer layout-has-fixed-header">
<div class="app-layout-canvas">
    <div class="app-layout-container">

        <!-- Drawer -->
        <aside class="app-layout-drawer">

            <!-- Drawer scroll area -->
            <div class="app-layout-drawer-scroll" style="margin-top: 50px;">
                <!-- Drawer logo -->
                <div id="logo" class="drawer-header"
                     style="text-align: center;margin: 0 auto;font-family: 华文楷体; padding-top: 20px;">
                    <span style="font-size: 34px;"><strong>我的账户</strong></span>
                </div>

                <!-- Drawer navigation -->
                <nav class="drawer-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item nav-drawer-header">
                            <hr color="#ccc">
                        </li>
                        <li class="nav-item">
                            <a href="${pageContext.request.contextPath}/jsp/MyAccount/MyMoneyRecord.jsp"><i class="ion-ios-speedometer-outline"></i>
                                <span>我的账户流水</span></a>
                        </li>
                        <li class="nav-item">
                            <a href="${pageContext.request.contextPath}/jsp/MyAccount/myInformation.jsp"><i class="ion-ios-monitor-outline"></i> 我的信息</a>
                        </li>
                        <li class="nav-item">
                            <a href="javascript:void(0)"><i class="ion-ios-monitor-outline"></i> <span style="font-size: 20px;">我的订单</span></a>
                        </li>
                        <li class="nav-item">
                            <a href="${pageContext.request.contextPath}/jsp/MyAccount/myReceiveAddress.jsp"><i class="ion-ios-monitor-outline"></i> 我的收获地址</a>
                        </li>
                        <li class="nav-item">
                            <a href="${pageContext.request.contextPath}/jsp/MyAccount/myOpinion.jsp"><i class="ion-ios-monitor-outline"></i> 我的评价</a>
                        </li>
                    </ul>
                </nav>
                <!-- End drawer navigation -->
            </div>
            <!-- End drawer scroll area -->
        </aside>
        <!-- End drawer -->

        <!-- Header -->
        <header class="app-layout-header">
            <nav class="navbar navbar-default">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                data-target="#header-navbar-collapse"
                                aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <button class="pull-left hidden-lg hidden-md navbar-toggle" type="button" data-toggle="layout"
                                data-action="sidebar_toggle">
                            <span class="sr-only">Toggle drawer</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="${pageContext.request.contextPath}/jsp/home/frontend_home.jsp">
                            <img class="img-responsive"
                                 src="${pageContext.request.contextPath}/assets/img/logo/logo-frontend.png"
                                 title="强强组合商城" alt="AppUI"/>
                        </a>
                    </div>

                    <div class="collapse navbar-collapse" id="header-navbar-collapse">
                        <ul id="main-menu" class="nav navbar-nav navbar-left">
                            <li class="">
                                <a href="${pageContext.request.contextPath}/jsp/home/frontend_home.jsp">首页</a>
                            </li>
                            <li class="">
                                <a href="#" data-toggle="dropdown">关于我们</a>
                            </li>
                        </ul>
                        <!-- .navbar-left -->

                        <ul class="nav navbar-nav navbar-right navbar-toolbar hidden-sm hidden-xs">
                            <li class="active" id="business">
                                <a href="frontend_home.html">注册为商家</a>
                            </li>
                            <li class="active" id="deliver">
                                <a href="frontend_home.html">注册为配送员</a>
                            </li>
                            <li class="dropdown">
                                <a href="javascript:void(0)" data-toggle="dropdown"><i class="ion-ios-bell"></i> <span class="badge">3</span></a>
                                <ul class="dropdown-menu dropdown-menu-right">
                                    <li class="dropdown-header">消息</li>
                                    <li>
                                        <a tabindex="-1" href="javascript:void(0)"><span class="badge pull-right">3</span> 有无内鬼？ </a>
                                    </li>
                                    <li>
                                        <a tabindex="-1" href="javascript:void(0)"><span class="badge pull-right">1</span> 不过如此 </a>
                                    </li>
                                    <li class="divider"></li>
                                    <li class="dropdown-header">公告</li>
                                    <li>
                                        <a tabindex="-1" href="javascript:void(0)">登dua郎..</a>
                                    </li>
                                </ul>
                            </li>

                            <li class="dropdown dropdown-profile">
                                <a href="javascript:void(0)" data-toggle="dropdown">
                                    <span class="m-r-sm">${account.accName}<span class="caret"></span></span>
                                    <img class="img-avatar img-avatar-48" src="${pageContext.request.contextPath}/file/acc/${account.accImg == null?"000000011612245316757212.png":account.accImg}" alt="User profile pic" />
                                </a>
                                <ul class="dropdown-menu dropdown-menu-right">
                                    <li>
                                        <a href="${pageContext.request.contextPath}/jsp/MyAccount/MyMoneyRecord.jsp">个人账户</a>
                                    </li>
                                    <li>
                                        <a href="${pageContext.request.contextPath}/jsp/MyAccount/myBuyCart.jsp">我的购物车</a>
                                    </li>
                                    <li>
                                        <a href="#" id="logout">退出</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                        <!-- .navbar-right -->
                    </div>
                </div>
                <!-- .container-fluid -->
            </nav>
            <!-- .navbar-default -->
        </header>
        <!-- End header -->

        <main class="app-layout-content">

            <!-- Page Content -->
            <div class="container-fluid p-y-md">
                <div class="card-block card-block-mini card-block-full">
                    <div class="text-center">
                        <span style="font-family: 华文楷体;font-size: 24px;">可选择：</span>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="未支付" id="beforePlay"><span>未支付</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="已支付" id="afterPlay"><span>已支付</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="已发货" id="ship"><span>已发货</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="正在配送" id="distri"><span>正在配送</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="已签收" id="signIn"><span>已签收</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="已评价" id="opin"><span>已评价</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="待退款" id="awaitMoney"><span>待退款</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="待换货" id="awaitBarter"><span>待换货</span></button>
                        <button class="btn btn-info" type="button" data-toggle="tooltip" title="完成退货退款" id="Finish"><span>完成退货退款</span></button>
                        <span style="font-family: 华文楷体;font-size: 24px;">显示列表</span>
                    </div>
                </div>
                <div class="card">
                    <div class="card-block">
                        <!-- If you put a checkbox in thead section, it will automatically toggle all tbody section checkboxes -->
                        <table class="table-vcenter table-hover table">
                            <thead>
                            <tr>
                                <th style="width: 15%;text-align: right;">宝贝</th>
                                <th style="width: 20%;"></th>
                                <th style="width: 15%;text-align: center;">单价</th>
                                <th style="width: 7%;text-align: center;">数量</th>
                                <th style="width: 10%;text-align: center;">实付款</th>
                                <th style="width: 10%;text-align: center;">交易状态</th>
                                <th style="width: 10%;text-align: center;">交易时间</th>
                                <th class="hidden-xs w-20" style="text-align: center;">交易操作</th>
                            </tr>
                            </thead>
                            <tbody id="orderContent">
                            <tr>
                                <td class="text-center">
                                    <label class="css-input css-checkbox css-checkbox-default">
                                        <div class="card m-b-0">
                                            <img class="img-responsive" src="${pageContext.request.contextPath}/assets/img/misc/frontend_about3.png" style="width: 130px;height: 100px;"
                                                 alt="User profile pic" />
                                        </div>
                                    </label>
                                </td>
                                <td class="hidden-xs">
                                    <p class="font-500 m-b-0"><span>iPhone 9999x</span></p>
                                    <p class="hidden-xs"><span>买到就是赚到！！！最新残次品，逼真仿造</span></p>
                                </td>
                                <td class="font-500 text-center"><span>￥999.99</span></td>
                                <td class="hidden-xs text-center">
                                    <span>8</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <span>999.99元</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <span>交易成功</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <span>2021-12-03</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <em class="text-muted">
                                        <button class="btn btn-app-orange" type="button" data-toggle="tooltip" title="" data-original-title="对商品的看法"><span>评价</span></button>
                                    </em>
                                    <div class="row" style="display: none;">
                                        <div class="card-block">
                                            <a href="#"><span>再次购买</span></a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="text-center">
                                    <label class="css-input css-checkbox css-checkbox-default">
                                        <div class="card m-b-0">
                                            <img class="img-responsive" src="${pageContext.request.contextPath}/assets/img/misc/frontend_about3.png" style="width: 130px;height: 100px;"
                                                 alt="User profile pic" />
                                        </div>
                                    </label>
                                </td>
                                <td class="hidden-xs">
                                    <p class="font-500 m-b-0"><span>iPhone 9999x</span></p>
                                    <p class="hidden-xs"><span>买到就是赚到！！！最新残次品，逼真仿造</span></p>
                                </td>
                                <td class="font-500 text-center"><span>￥999.99</span></td>
                                <td class="hidden-xs text-center">
                                    <span>8</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <span>999.99元</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <span>交易失败</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <span>2021-1-31</span>
                                </td>
                                <td class="hidden-xs font-500 text-center">
                                    <em class="text-muted" style="display: none;">
                                        <button class="btn btn-app-orange" type="button" data-toggle="tooltip" title="" data-original-title="评价"><span>评价</span></button>
                                    </em>
                                    <div class="row">
                                        <div class="card-block">
                                            <a href="#"><span>再次购买</span></a>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <br />
                        <div class="text-center">
                            <button class="btn btn-info" type="button" data-toggle="tooltip" title="首页" id="first"><i class="fa fa-angle-double-left"></i></button>&nbsp;&nbsp;&nbsp;
                            <button class="btn btn-info" type="button" data-toggle="tooltip" title="上一页" id="left"><i class="fa fa-angle-left"></i></button>&nbsp;&nbsp;&nbsp;
                            <button class="btn btn-info" type="button" data-toggle="tooltip" title="下一页" id="right"><i class="fa fa-angle-right"></i></button>&nbsp;&nbsp;&nbsp;
                            <button class="btn btn-info" type="button" data-toggle="tooltip" title="尾页" id="last"><i class="fa fa-angle-double-right"></i></button>&nbsp;&nbsp;&nbsp;
                            总页数:<span id="allGoodsPage"></span>&nbsp;&nbsp;当前为第<span id="pageCurrent"></span>页
                        </div>
                    </div>
                    <!-- .card-block -->

                </div>
                <!-- .card -->

            </div>
            <!-- End Page Content -->
    <!-- .row -->
        </main>

    </div>
    <!-- .app-layout-container -->
</div>

<!-- .app-layout-canvas -->

<!-- AppUI Core JS: jQuery, Bootstrap, slimScroll, scrollLock and App.js -->
<!-- AppUI Core JS: jQuery, Bootstrap, slimScroll, scrollLock and App.js -->
<script src="${pageContext.request.contextPath}/assets/js/core/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/core/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/core/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/core/jquery.scrollLock.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/core/jquery.placeholder.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/app-custom.js"></script>

<!-- Page JS Plugins -->
<script src="${pageContext.request.contextPath}/assets/js/plugins/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/plugins/bootstrap-colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/plugins/select2/select2.full.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/plugins/masked-inputs/jquery.maskedinput.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/plugins/dropzonejs/dropzone.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/plugins/jquery-tags-input/jquery.tagsinput.min.js"></script>
<div class="app-ui-mask-modal"></div>

<script src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
<script src="${pageContext.request.contextPath}/js/layui/layui.js"></script>

<script type="text/javascript">
    $(function () {
        //商家id
        var accId = ${account.accId};
        var pageSize = 8;//每页显示2笔数据
        var pageCurrent = 1;//当前页数
        var ordStatus;//订单的状态
        var goodsCount=0;//数据笔数
        var allGoodsPage = 0;//总页数
        getMyOrderInfo();//获取订单信息并回显
        function getMyOrderInfo() {
            var url = "${pageContext.request.contextPath}/sureOrder/selectMyOrder";
            var param = {
                accId:accId,
                ordStatus:ordStatus,
                pageCurrent:pageCurrent,
                pageSize:pageSize
            }
            $.get(url,param,function (data) {
                if (data.code == 1001){
                    $("#pageCurrent").html(pageCurrent);
                    goodsCount = data.orderNum;
                    /*设置数据总笔数*/
                    allGoodsPage = parseInt(goodsCount/(pageSize+1))+1;
                    $("#allGoodsPage").html(allGoodsPage);
                    $("#orderContent").html("");
                    var content = "";
                    for (var i = 0; i < data.orderDetailAndGoods.length; i++) {
                        content += "<tr><td class='text-center'><label class='css-input css-checkbox css-checkbox-default'><div class='card m-b-0'>";
                        content += "<img class='img-responsive' src='${pageContext.request.contextPath}/file/goodsInfo/"+data.orderDetailAndGoods[i].goods.imgUrl+"' style='width: 130px;height: 100px;'/>";
                        content += "</div></label></td><td class='hidden-xs'>";
                        content += "<p class='font-500 m-b-0'><span>"+data.orderDetailAndGoods[i].goods.goNm+"</span></p>";
                        content += "<p class='hidden-xs'><span>"+data.orderDetailAndGoods[i].goods.goDp+"</span></p>";
                        content += "</td><td class='font-500 text-center'><span>￥"+data.orderDetailAndGoods[i].goods.goPri+"</span></td>";
                        content += "<td class='hidden-xs text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.goNum+"</span></td>";
                        content += "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.totalPrice+"</span></td>";
                        switch (data.orderDetailAndGoods[i].orderDetail.ordStatus) {
                            case '1':content += "<td class='hidden-xs font-500 text-center'><span>未支付</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.placeTime+"</span></td>";break;
                            case '2':content += "<td class='hidden-xs font-500 text-center'><span>已支付</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.payTime+"</span></td>";break;
                            case '3':content += "<td class='hidden-xs font-500 text-center'><span>已发货</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.payTime+"</span></td>";break;
                            case '4':content += "<td class='hidden-xs font-500 text-center'><span>正在配送</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.payTime+"</span></td>";break;
                            case '5':content += "<td class='hidden-xs font-500 text-center'><span>交易成功</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.receTime+"</span></td>";break;
                            case '6':content += "<td class='hidden-xs font-500 text-center'><span>已评价</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.receTime+"</span></td>";break;
                            case '7':content += "<td class='hidden-xs font-500 text-center'><span>待退款</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.receTime+"</span></td>";break;
                            case '8':content += "<td class='hidden-xs font-500 text-center'><span>待换货</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.applyReturnTime+"</span></td>";break;
                            case '9':content += "<td class='hidden-xs font-500 text-center'><span>完成退货退款</span></td>" +
                                "<td class='hidden-xs font-500 text-center'><span>"+data.orderDetailAndGoods[i].orderDetail.returnSuccTime+"</span></td>";break;
                        }
                        content += "<td class='hidden-xs font-500 text-center'>";
                        switch (data.orderDetailAndGoods[i].orderDetail.ordStatus) {
                            case '1':content += "<em class='text-muted'><button class='btn btn-app-orange' type='button' title='去支付' id='goPlay' value='"+data.orderDetailAndGoods[i].orderDetail.ordId+"'><span>去支付</span></button></em>";break;
                            case '2':content += "<div class='row'><div class='card-block'><span>等待商家发货</span></div></div>";break;
                            case '3':content += "<div class='row'><div class='card-block'><span>已发货</span></div></div>";break;
                            case '4':content += "<div class='row'><div class='card-block'><span>正在配送</span></div></div>";break;
                            case '5':content += "<em class='text-muted'><button class='btn btn-app-orange' type='button' title='评价' id='goOpinion' value='"+data.orderDetailAndGoods[i].orderDetail.detId+","+data.orderDetailAndGoods[i].goods.goId+"'><span>评价</span></button></em>";break;
                            case '6':content += "<em class='text-muted'><button class='btn btn-app-orange' type='button' title='退货'><span>退货</span></button></em>";break;
                            case '7':content += "<div class='row'><div class='card-block'><span>已申请退款</span></div></div>";break;
                            case '8':content += "<div class='row'><div class='card-block'><span>已申请换货</span></div></div>";break;
                            case '9':content += "<div class='row'><div class='card-block'><span>完成退货退款</span></div></div>";break;
                        }
                        content += "</td></tr>";
                    }
                    $("#orderContent").html(content);
                }
            });
        }
        /*  去支付按钮   */
        $("#orderContent").delegate("#goPlay","click",function () {
            var ordId = $(this).val();
            window.location.href = "${pageContext.request.contextPath}/jsp/MyOrder/ensure_order.jsp?ordId="+ordId;
        });
        /*  去评价按钮   */
        $("#orderContent").delegate("#goOpinion","click",function () {
            var isOpini = $(this).val();
            window.location.href = "${pageContext.request.contextPath}/jsp/MyAccount/goodOpinion.jsp?isOpini="+isOpini;
        });
        /*  不同订单状态按钮显示--start  */
        $("#beforePlay").click(function () {
            if (ordStatus == 1){
                ordStatus = null;
            }else {
                ordStatus = 1;
            }
            getMyOrderInfo();
        });
        $("#afterPlay").click(function () {
            if (ordStatus == 2){
                ordStatus = null;
            }else {
                ordStatus = 2;
            }
            getMyOrderInfo();
        });
        $("#ship").click(function () {
            if (ordStatus == 3){
                ordStatus = null;
            }else {
                ordStatus = 3;
            }
            getMyOrderInfo();
        });
        $("#distri").click(function () {
            if (ordStatus == 4){
                ordStatus = null;
            }else {
                ordStatus = 4;
            }
            getMyOrderInfo();
        });
        $("#signIn").click(function () {
            if (ordStatus == 5){
                ordStatus = null;
            }else {
                ordStatus = 5;
            }
            getMyOrderInfo();
        });
        $("#opin").click(function () {
            if (ordStatus == 6){
                ordStatus = null;
            }else {
                ordStatus = 6;
            }
            getMyOrderInfo();
        });
        $("#awaitMoney").click(function () {
            if (ordStatus == 7){
                ordStatus = null;
            }else {
                ordStatus = 7;
            }
            getMyOrderInfo();
        });
        $("#awaitBarter").click(function () {
            if (ordStatus == 8){
                ordStatus = null;
            }else {
                ordStatus = 8;
            }
            getMyOrderInfo();
        });
        $("#Finish").click(function () {
            if (ordStatus == 9){
                ordStatus = null;
            }else {
                ordStatus = 9;
            }
            getMyOrderInfo();
        });
        /*  不同订单状态按钮显示--end  */

        /* 分页按钮--start */
        $("#right").click(function () {
            if (allGoodsPage < pageCurrent+1){
                return false;
            }
            pageCurrent += 1;
            $("#pageCurrent").html(pageCurrent)
            getMyOrderInfo();
        })
        $("#left").click(function () {
            if (pageCurrent-1 < 1){
                return false;
            }
            pageCurrent -= 1;
            $("#pageCurrent").html(pageCurrent)
            getMyOrderInfo();

        })
        $("#first").click(function () {
            if (pageCurrent == 1){
                return false;
            }
            pageCurrent = 1;
            $("#pageCurrent").html(pageCurrent)
            getMyOrderInfo();
        });
        $("#last").click(function () {
            if (pageCurrent == allGoodsPage){
                return false;
            }
            pageCurrent = allGoodsPage;
            $("#pageCurrent").html(pageCurrent)
            getMyOrderInfo();
        });
        /* 分页按钮--end */

        /*动态显示首页头部*/
        var role = ${account.role};
        if(role == 2){
            $("#business").html("<a href='../business/UnFinishOrder.jsp'>商家后台</a>");
            $("#deliver").html("");
        }
        if(role == 3){
            $("#business").html("");
            $("#deliver").html("<a href='#'>配送员后台</a>");
        }
        /*退出登录*/
        $("#logout").click(function (event){
            event.preventDefault();
            var url = "/login/logoutShop";
            $.post(url,function (){
                window.location.href = "../../login.jsp";
            })
        })
        //模态框居中问题 start
        function centerModals() {
            $('.modal').each(function (i) {
                var $clone = $(this).clone().css('display', 'block').appendTo('body');
                var top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);
                top = top > 50 ? top : 0;
                $clone.remove();
                $(this).find('.modal-content').css("margin-top", top - 50);
            });
        }

        // 在模态框出现的时候调用垂直居中方法
        $('.modal').on('show.bs.modal', centerModals);
        // 在窗口大小改变的时候调用垂直居中方法
        $(window).on('resize', centerModals);
        //模态框居中问题end

    });
</script>

</body>

</html>
